/*
# File    :   trie_tree_demo.c
# Author  :   SCHIPS
# Mail    :   schips@dingtalk.com
# Git     :   https://gitee.com/schips/
# Date    :   Sun, May 26, 2019 10:24:16 PM
*/

#include <stdio.h>
#include "trie_tree.h"

int main(int argc, char *argv[])
{
    int ret;
    TrieNode* p;
    p = CreateTrieNode();
    InsertTrie(&p,"test1");
    printf("Insert : test1\n");
    InsertTrie(&p,"apple111111111:w");
    printf("Insert : apple111111111:w\n");
    InsertTrie(&p,"patch");
    printf("Insert : patch\n");
    InsertTrie(&p,"banana");
    printf("Insert : banana\n");

    ret = SearchTrie(&p,"banana");
    printf("SearchTrie : banana [%d]\n", ret);

    ret = SearchTrie(&p,"apple");
    printf("SearchTrie : apple [%d]\n", ret);

    ret = SearchTrie(&p,"pple");
    printf("SearchTrie : pple [%d]\n", ret);

    ret = SearchTrie(&p,"");
    printf("SearchTrie :  [%d]\n", ret);

    ret = SearchTrie(&p,"apple111111111:w");
    printf("SearchTrie : apple111111111:w [%d]\n", ret);

    ret = SearchTrie(&p,"cat");
    printf("SearchTrie : cat [%d]\n", ret);

    return 0;
}
